/*--------------------------------------------------------------
 * File: demo23.c 编码类型：C语言  UTF-8
 * Author WRS (1352509846@qq.com)
 * 功能: 输出指定数量的斐波那契额数列
 * Version 0.1
 * Date 2022-01-16 
 * 
 * @copyright Copyright (c) 2022
 * 
----------------------------------------------------------------*/
#include <stdio.h>

int main(int argc, char const *argv[])
{
    int i,n,t1=1,t2=1,nextTerm;

    printf("请输入要输出的个数：");
    scanf("%d",&n);

    printf("斐波那契数列：");
    for(i=1; i<=n; i++)
    {
        printf("%d ",t1);
        nextTerm = t1+t2;
        t1 = t2;
        t2 = nextTerm;
    }
    putchar('\n');
    return 0;
}
